/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Manager_Image_Utils;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.GradientPaint;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.RenderingHints;
import java.awt.image.BufferedImage;
import javax.swing.Icon;
import javax.swing.JButton;

/**
 *
 * @author Admin
 */
public class ButtonCloseFullScreen extends JButton{
    public static boolean isClicked = false;
    private Image BIicon;
    public Dimension getPreferredSize()
    {
        return (new Dimension(100, 40));
    }

    public ButtonCloseFullScreen(Image BIicon, Icon icon) {
        super(icon);
        this.BIicon = BIicon;
    }

    public Image getBIicon() {
        return BIicon;
    }

    public void setBIicon(Image BIicon) {
        this.BIicon = BIicon;
    }

    
    


    public ButtonCloseFullScreen(Icon icon) {
        super(icon);
    }
    public void paintComponent(Graphics gr)
    {
        
        if (!isClicked){
            int x=this.getHorizontalAlignment();
            int y=this. getVerticalAlignment();
            int W=this.getWidth();
            int H=this.getHeight();
            int scale=40;
            gr.setColor(Color.black);
            gr.drawOval(x, y-H/2, W+scale, H+scale);
            gr.setColor(Color.black);
            gr.fillOval(x, y-H/2, W+scale, H+scale);
            gr.setColor(Color.black);
            gr.drawImage(getBIicon(),x+scale-20,y+H/2-scale,null);
        }
        else
        {
             super.paintComponent(gr);
        }       
    }
}
